<?php 
header("Pragma: public");
header("Expires: 0");
header("Accept-Ranges: bytes");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-word");
header('Content-Disposition: attachment; filename=studentsforbanklist.xls');
header("Content-Transfer-Encoding: binary");

?>
<h2>
	<?php 
		echo 'факультет '.$facultets[$facultet_id].' '.$professions[$profession_id].' '.$learningforms[$learningform_id].' '.$learningtypes[$learningtype_id];
	?>
</h2>
  <h1>Список зачисленных по алфавиту</h1>
  
    <table width="100%" cellspacing="2" cellpadding="0" border=1>
  <tr>
    <th><strong>id</strong></th>
    <th><strong>Фамилия</strong></th>
    <th><strong>Имя</strong></th>
    <th><strong>Отчество</strong></th>
    <th><strong>Пол</strong></th>
    <th><strong>Дата рождения</strong></th>    
    <th><strong>Место рождения</strong></th>   
    <th><strong>Гражданство</strong></th>
    <th><strong>Паспорт серия</strong></th>
    <th><strong>Паспорт номер</strong></th>
    <th><strong>Кем когда выдан</strong></th>   
    <th><strong>Адрес</strong></th>        
    <th><strong>Телефон</strong></th>
  </tr>
  <?php 
  foreach ($abiturients as $abiturient):
  echo '<tr>';
  echo '<td>';
  echo $abiturient['Abiturient']['id'];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['lastname'];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['firstname'];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['surname'];
  echo '</td>';
  echo '<td>';
  echo $genders[$abiturient['Abiturient']['gender_id']]; 
  echo '</td>';  
  echo '<td>';
  echo $abiturient['Abiturient']['birthdate'];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['passport_birthplace'];
  echo '</td>';
  echo '<td>';
  echo $citizenships[$abiturient['Abiturient']['citizenship_id']];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['passport_ser'];
  echo '</td>';
  echo '<td>';
  echo $abiturient['Abiturient']['passport_num'];
  echo '</td>';  
  echo '<td>';
  echo $abiturient['Abiturient']['passport_data'];
  echo '</td>';  
  echo '<td>';
  echo $abiturient['Abiturient']['adress'];
  echo '</td>';  
  echo '<td>';
  echo $abiturient['Abiturient']['phone'].' ';
  echo $abiturient['Abiturient']['mobile'].' ';
  echo '</td>';  
  echo '</tr>';  
  endforeach;
  
  ?>
  </table>